package com.xr.miniprogram.domain.vo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.xr.common.annotation.Excel;
import com.xr.miniprogram.domain.MiniProgramOrder;
import com.xr.miniprogram.domain.MiniProgramOrderStatus;
import com.xr.miniprogram.domain.MiniProgramOrderUser;
import lombok.AllArgsConstructor;
import lombok.Data;

import java.util.Date;

/**
 * description: 订单子项vo，处理状态值
 *
 */
@Data
public class MiniProgramOrderUserVO {
    private static final long serialVersionUID = 1L;

    /**
     * 订单用户id
     */
    @TableId(value = "order_user_id", type = IdType.AUTO)
    private Long orderUserId;

    /**
     * 订单id
     */
    private Long orderId;

    /**
     * 订单编号
     */
    private String orderNumber;

    /**
     * 订单地址
     */
    private String orderAddress;

    /**
     * 位置信息
     */
    private String location;

    /**
     * 联系人
     */
    private String receiver;

    /**
     * 联系电话
     */
    private String receiverPhone;

    /**
     * 服务时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm")
    private Date serviceTime;

    /**
     * 工作时间
     */
    private Long workTime;

    /**
     * 保洁区域(0表示正常保洁，1表示重点保洁)
     */
    private String cleanAreas;
    /**
     * 订单服务日志id
     */
    private Long serverLogId;

    private MiniProgramOrderStatus orderStatus;

    public MiniProgramOrderUser toMiniProgramOrderUser(MiniProgramOrderUserVO item){
        MiniProgramOrderUser orderUser = new MiniProgramOrderUser();
        orderUser.setOrderUserId(item.getOrderUserId());
        orderUser.setOrderNumber(item.getOrderNumber());
        orderUser.setOrderAddress(item.getOrderAddress());
        orderUser.setLocation(item.getLocation());
        orderUser.setReceiver(item.getReceiver());
        orderUser.setReceiverPhone(item.getReceiverPhone());
        orderUser.setServiceTime(item.getServiceTime());
        orderUser.setWorkTime(item.getWorkTime());
        orderUser.setCleanAreas(item.getCleanAreas());
        orderUser.setServiceLogId(item.getServerLogId());
        orderUser.setOrderId(item.getOrderId());
        return orderUser;
    }

}
